
Page({
  data: {
	tabs: [
		{
			id: 0,
			value: '体验问题',
			isActive: true
		},
		{
			id: 1,
			value: '商品、商家投诉',
			isActive: false
		}
	],
	imgArr:[]
  },
  handleTabsItemChange(e){
  	  const index = e.detail
  	  let {tabs} = this.data
  	  
  	  tabs.forEach((item, index2) => {
  	  	index2 === index ?
  	  	item.isActive = true :
  	  	item.isActive = false;
  	  })
  	  // 赋值
  	  this.setData({
  	  	tabs
  	  })
  },
  handleChooseImg(){
	  wx.chooseImage({
		  count:20,
		  sizeType:['original', 'compressed'],
		  sourceType:['album', 'camera'],
		  success:(res)=>{
			  
			  this.setData({
				  imgArr:[...this.data.imgArr,...res.tempFilePaths]
			  })
		  }
	  })
  },
  handleRemoveImg(e){
	const {index} = e.currentTarget.dataset
	let imgArr = this.data.imgArr
	imgArr.splice(index,1)
	this.setData({
		imgArr
	})
  }
})